<html>
<head><meta charset="utf-8"><title>contribute · project-portable-simd · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/index.html">project-portable-simd</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html">contribute</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="218141303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/218141303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jan Van Sweevelt <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#218141303">(Nov 28 2020 at 01:44)</a>:</h4>
<p>hey all, looking for a way how I can contribute to this</p>



<a name="218150628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/218150628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#218150628">(Nov 28 2020 at 06:21)</a>:</h4>
<p>I think the <em>most pressing</em> issues are</p>
<ul>
<li>getting SIMD intrinsics into rustc itself so that rustc can correctly lower rust SIMD stuff according to the codegen backend used (either LLVM or Cranelift). I think there's some PR progress on this but i'm not sure if the one PR will resolve all of the rustc intrinsics concerns.</li>
<li>getting the stdsimd to have all the various methods. Each method that's part of the (eventually) stable API will <em>internally</em> call an intrinsic. Not every  function will use exactly one intrinsic, just the "base" level functions. And then other functions will build on top of that. For example, <code>sin</code> and <code>cos</code> aren't intrinsic ops, they're implemented using a bunch of intrinsic add, truncate, mul, etc. ops though.</li>
</ul>



<a name="218228953"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/218228953" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#218228953">(Nov 29 2020 at 20:29)</a>:</h4>
<p><code>sin</code> and <code>cos</code> should be intrinsics, they're supported by LLVM and some processors have special instructions to implement them (e.g. AMDGPU, Libre-SOC's CPU/GPU)</p>



<a name="218386724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/218386724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#218386724">(Dec 01 2020 at 07:11)</a>:</h4>
<p>okay well then pick whatever other useful op you care to name that's built using other intrinsics</p>



<a name="220788038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220788038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jan Van Sweevelt <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220788038">(Dec 23 2020 at 13:24)</a>:</h4>
<p>hi all, finally holidays so spending time with simd and the rust compiler.</p>



<a name="220788071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220788071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jan Van Sweevelt <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220788071">(Dec 23 2020 at 13:25)</a>:</h4>
<p>I have some questions while I am trying to find my way in this code base</p>



<a name="220788155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220788155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jan Van Sweevelt <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220788155">(Dec 23 2020 at 13:26)</a>:</h4>
<p><a href="http://intrinsics.rs">intrinsics.rs</a> is the file where the currently implemented simd intrinsics are declared</p>



<a name="220788228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220788228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jan Van Sweevelt <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220788228">(Dec 23 2020 at 13:27)</a>:</h4>
<p>these intrinsics points to the rust compiler implemented intrinsics in the file: library/stdarch/crates/core_arch/src/simd_llvm.rs</p>



<a name="220788323"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220788323" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jan Van Sweevelt <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220788323">(Dec 23 2020 at 13:28)</a>:</h4>
<p>as commented in the <a href="http://intrinsics.rs">intrinsics.rs</a> file we now generate llvm intrinsics and let llvm generate the simd instructions for the platform.</p>



<a name="220788352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220788352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jan Van Sweevelt <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220788352">(Dec 23 2020 at 13:28)</a>:</h4>
<p>we do not use the wrappers in the core arch crate</p>



<a name="220788381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220788381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jan Van Sweevelt <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220788381">(Dec 23 2020 at 13:29)</a>:</h4>
<p>So far, is this reasoning correct ?</p>



<a name="220788553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220788553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jan Van Sweevelt <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220788553">(Dec 23 2020 at 13:31)</a>:</h4>
<p>extending the amount of implemented intrinsics require to extend the <a href="http://intrinsics.rs">intrinsics.rs</a> file and extend the rust complier if necessary, in the library/starch/crates/core_arch/simd_llvm.rs</p>



<a name="220788664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220788664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jan Van Sweevelt <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220788664">(Dec 23 2020 at 13:32)</a>:</h4>
<p>correct ?</p>



<a name="220788835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220788835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jan Van Sweevelt <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220788835">(Dec 23 2020 at 13:35)</a>:</h4>
<p>Is it possible to test what is currently available in stdsimd to use in an application ? I don't wanna use it in a commercial application, but I want to build functionality that I use on a daily base in my dayjob (image resizing, filtering, tensor transformations, ...) to run some benchmarks.</p>



<a name="220788931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220788931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220788931">(Dec 23 2020 at 13:36)</a>:</h4>
<p>The intrinsics we are using don't point to core::arch, but special functions that are exposed directly by rustc</p>



<a name="220788969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220788969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jan Van Sweevelt <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220788969">(Dec 23 2020 at 13:36)</a>:</h4>
<p>ok where can they be found ?</p>



<a name="220789112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220789112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220789112">(Dec 23 2020 at 13:38)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_codegen_llvm/src/intrinsic.rs">https://github.com/rust-lang/rust/blob/master/compiler/rustc_codegen_llvm/src/intrinsic.rs</a></p>



<a name="220789124"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220789124" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220789124">(Dec 23 2020 at 13:39)</a>:</h4>
<p>This file has the implementation for the LLVM backend</p>



<a name="220789227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220789227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220789227">(Dec 23 2020 at 13:40)</a>:</h4>
<p>Also, you can use the stdsimd crate that's currently on github, however it's changing quite frequently and is still missing most functionality</p>



<a name="220789753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220789753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jan Van Sweevelt <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220789753">(Dec 23 2020 at 13:48)</a>:</h4>
<p>thank you Caleb, I am continuing with this information</p>



<a name="220841143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/220841143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#220841143">(Dec 24 2020 at 01:05)</a>:</h4>
<p>Note that <strong>currently</strong> the crate must be depended on directly in <code>Cargo.toml</code>, and it's not on <a href="http://crates.io">crates.io</a> so you'll need to use a git url. Also, work is slightly on hold during December.</p>
<p>However, when things pick back up we'd like to work toward having the crate shipped as part of <code>core</code> (though you'd still need a Nightly compiler to use an unstable part of <code>core</code>)</p>



<a name="221448554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/221448554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jan Van Sweevelt <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#221448554">(Jan 03 2021 at 12:23)</a>:</h4>
<p>Yes I do that all the time</p>



<a name="223499525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/223499525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Guoqiang QI <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#223499525">(Jan 21 2021 at 12:12)</a>:</h4>
<p>Hey all, I noticed that there are two simd related repositories on the Github,packed_simd and std::simd.Is there any connection between them?</p>



<a name="223502246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/223502246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ashley Mannix <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#223502246">(Jan 21 2021 at 12:43)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="382762">@Guoqiang QI</span>! <span aria-label="wave" class="emoji emoji-1f44b" role="img" title="wave">:wave:</span> <code>packed_simd</code> is an earlier iteration of a portable SIMD API. <code>stdsimd</code> is where we’re currently working to get something into the standard library. It builds off the work done in <code>packed_simd</code> but also takes advantage of new language features that have come along since, like const generics</p>



<a name="223593652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/223593652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Guoqiang QI <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#223593652">(Jan 22 2021 at 01:26)</a>:</h4>
<p><span class="user-mention" data-user-id="204346">@Ashley Mannix</span> Get it and so sorry about the delay due to time difference. I'm a rust novice, but in the past I've had a lot of experiences with simd, so i will be happy to try contributing to the rust simd module when i have a spare time. Thank you again for your reply.</p>



<a name="223594367"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/223594367" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ashley Mannix <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#223594367">(Jan 22 2021 at 01:38)</a>:</h4>
<p><span class="user-mention" data-user-id="382762">@Guoqiang QI</span> Even if you have some thoughts on your experiences using SIMD in other languages to share those are great contributions too and all feedback is welcome</p>



<a name="223594967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/223594967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Guoqiang QI <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#223594967">(Jan 22 2021 at 01:49)</a>:</h4>
<p><span class="user-mention" data-user-id="204346">@Ashley Mannix</span> In the past few months, i have mainly participated in the development and optimization of simd in the Eigen project. Eigen is a basic linear algebra library which optimizes the underlying calculations on different hardware to varying degrees, so i am also thinking about whether there is an opportunity to introduce some of its optimization methods into rust. Of course, these have a premise that it is equivalent to a significant performance improvement in the current implementation.</p>



<a name="223595807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/223595807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Guoqiang QI <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#223595807">(Jan 22 2021 at 02:04)</a>:</h4>
<p><span class="user-mention" data-user-id="204346">@Ashley Mannix</span> <br>
I noticed that the main purpose of std::simd is to provide a general simd api to shield the interface differences caused by the hardware, so whether the api completion job is one of a key point in std::simd? Or i just misunstand it.Also be happy to listen your suggestiones.</p>



<a name="223596358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/223596358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#223596358">(Jan 22 2021 at 02:14)</a>:</h4>
<p><span class="user-mention" data-user-id="382762">@Guoqiang QI</span> I've used eigen, std::simd is a much lower level interface but should make it much easier to write something like eigen that works well on all hardware</p>



<a name="223597924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/contribute/near/223597924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Guoqiang QI <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/contribute.html#223597924">(Jan 22 2021 at 02:45)</a>:</h4>
<p><span class="user-mention" data-user-id="312331">@Caleb Zulawski</span> I think it may just like the Core/Arch module in Eigen and some work was done in std::arch.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>